Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXUI-2058: Add error message on staffUI #3778

Merged
merged 7 commits into from
Jul 22, 2024
Merged

EXUI-2058: Add error message on staffUI #3778

merged 7 commits into from
Jul 22, 2024

Conversation

Josh-HMCTS
Copy link
Contributor

Jira link (if applicable)

https://tools.hmcts.net/jira/browse/EXUI-2058

Change description

Add error message on staffUI

olusegz07
olusegz07 previously approved these changes Jul 15, 2024
RiteshHMCTS
RiteshHMCTS previously approved these changes Jul 16, 2024
Copy link
Contributor

@andywilkinshmcts andywilkinshmcts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite minor changes, but probably worth doing

takeUntil(this.unsubscribe$),
tap((error) => {
this.staffSelectError = !!error;
this.staffSelectErrors = error ? { title: 'Staff error', description: error.errorDescription } : null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use optional chaining on error?.errorDescription, or possibly a ternary:
error ? { title: 'Staff error', description: error.errorDescription ? error.errorDescription : "unknown error" } : null

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added optional chaining and ternary

return this.staffDataAccessService.fetchSingleUserById(route.params.id).pipe(
map((user) => StaffUser.from(user))
tap((user:StaffUser) => console.log('User:', user)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you should commit this console.log

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, will remove

@RiteshHMCTS RiteshHMCTS merged commit 97962c9 into master Jul 22, 2024
3 checks passed
@RiteshHMCTS RiteshHMCTS deleted the fix/exui-2058 branch July 22, 2024 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants